fix clipped cache when using multiple objects with cacheless filters#979
Open
adabru wants to merge 1 commit intoCreateJS:masterfrom
Open
fix clipped cache when using multiple objects with cacheless filters#979adabru wants to merge 1 commit intoCreateJS:masterfrom
adabru wants to merge 1 commit intoCreateJS:masterfrom
Conversation
Author
|
Ok, I have a new workaround by just patching this function with overriding |
|
Thanks for the detailed writeup of this. I want to take some time and study the problem, make sure it's not indicative of something else getting missed. We'll let you know when we merge a fix for this even if it's not the PR. Glad you're able to work around it though! |
Member
|
We are looking this week at merging this.
|
Author
|
Done. The only and sufficient change is that the bounds are reassigned to null after each iteration so that no child is evaluated with the bounds of its previous sibling. |
varyndev
added a commit
to VarynInc/EaselJS
that referenced
this pull request
Dec 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following code will clip
objectBigto the size ofobjectSmallon the second update call:https://codepen.io/adabru/pen/aaOxZb?editors=1000
The error comes from following code:
EaselJS/src/easeljs/display/StageGL.js
Lines 2619 to 2620 in c7b6035
EaselJS/src/easeljs/display/StageGL.js
Lines 2631 to 2644 in c7b6035
On the first update call, every item will go into the
if (item.bitmapCache === null)branch and theboundsvariable will be assigned to the correct bounds. On the second update call however, no item will go into this branch asbitmapCacheis assigned for each of them. Thereforeboundsis assigned by the linebounds = bounds || item.getBounds();. Asboundsisnullon declaration, the first item will get its correct bounds assigned with this statement. BUT asboundsis declared asvarand therefore its scope is for the entire function, the next items will pick the first item's bounds and thus be clipped if they are smaller than the first item.One fix could be to use
var bounds = null;. The fix in this pull request is usinglet bounds;instead to block-scope theboundsvariable.See https://codepen.io/adabru/pen/rZVZyX?editors=1000 .
letsyntax is not handled bygrunt-contrib-uglifydefault branch, so this pull request also changes this dependency to itsgrunt-contrib-uglify-esbranch (https://github.com/gruntjs/grunt-contrib-uglify/tree/harmony).My workaround at the moment is using a fork of this repo. I hope this issue can soon be fixed in master.